"use strice";

const Controller = require('../common/shop')

class GoodsSkuController extends Controller {

  tableName = 'site'

  async siteInfo (){
    let siteId = await this.getSiteId()
    let result = await this.consult({site_id:siteId[0].site_id});
    // let data= await this.consult()
    this.resData(0,"获取成功",result)
  }
  async siteEdit (){
    let siteId = await this.getSiteId()
    let site_id = siteId[0].site_id
    // let data= await this.consult()
    console.log('前端表单提交的数据',this.ctx.request.body)
    const {logo, avatar, banner, seo_description, seo_keywords} = this.ctx.request.body
    let result = await this.update({logo, seo_description, seo_keywords}, {site_id})
    this.tableName = 'shop'
    let result1 = await this.update({avatar, banner}, {site_id})
    console.log(result, result1);
    this.resData(0,"成功")
  }

}

module.exports = GoodsSkuController